<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/taglibs.jsp"%>
<head>
<meta name="decorator" content="blank">
<title>iobike - Login</title>
</head>

<body class="login">

	<div class="embedded-container">
			<div class="plain-logo">
				<%--<h3><a class="brand" href="${ctx}"><strong>yasoo</strong></a></h3> --%>
				<a href="${ctx}"><img alt="Logo-full" src="${ctx}/themes/common/images/iobike_logo_full.png" /></a>
			</div>
		<div class="login">
			<article>
			    <form id="loginForm" action="j_spring_security_check" validate="true" method="post">
					<legend><h2><s:text name="button.signIn"/></h2></legend>
					<fieldset>
						<c:if test="${not empty param.login_error}">
							<div class="alert alert-error">
							  <button type="button" class="close" data-dismiss="alert">×</button>
							          <s:text name="message.error"/> <s:text name="error.login"/>
							</div>
						</c:if>
						<input class="input-block-level string required" id="email" name="j_username"
							placeholder="<s:text name='username'/>" size="40" type="text" />
						<input class="input-block-level password required" id="password" name="j_password" 
							placeholder="<s:text name='password'/>" size="40" type="password" />
					</fieldset>
					<s:submit id="submit" key="button.signIn" cssClass="btn btn-primary btn-large"/>
				</form>
			    <div>
				    <a class="btn-link help-block" href="${ctx}/user!showForgotPasswordPage.action">Forgot your password?</a>
				    <a class="btn-link help-block" href="${ctx}/user!showResendConfirmationEmailPage.action">Didn't receive your confirmation email?</a>
				</div>
		    </article>
		  
		  <footer>
		    <h3 class="muted">No account? <a href="${ctx}/showSignUpPage.action">Sign up now</a></h3>
		  </footer>
	  </div>
	</div>


<script type="text/javascript">
$(document).ready(function() {
    // validate signup form on keyup and submit 
    var validator = $("#loginForm").validate({ 
        debug: false,
        onkeyup: false,
        rules: { 
		    'j_username': { 
		        required: true
		    },
            'j_password': { 
                required: true, 
                minlength: 6 
            }
        }, 
        // the errorPlacement has to take the table layout into account 
        errorPlacement: function(error, element) { 
            if ( element.is(":radio") ) 
                error.appendTo( element.parent().next().next() ); 
            else if ( element.is(":checkbox") ) 
                error.appendTo ( element.parent().next() ); 
            else {
                error.insertAfter( element );
            } 
        }
    });
    
	var support = (function(input) {  
	    return function(attr) { return attr in input; };
	})(document.createElement('input')); 
	if ( !(support('placeholder') && $.browser.webkit) ) { 
	    $("form input").placeholder({//text是使用placeholder的input的类  
	        useNative: false,  
	        hideOnFocus: false,  
	        style: {  
	            textShadow: 'none'  
	        }  
	    });
	}  
	document.all.j_username.focus();
}); 
</script>
</body>